# -*- coding:UTF-8 -*-
"""
@Project : pythonProject
@File    : Calculator.py
@IDE     : PyCharm
@Author  : WorldWind(1772830365@qq.com)
@Date    : 2025/7/5 下午2:59
"""
try:
    while 1:
        num1 = input("请输入第一个数据！：")
        try:
            num1 = float(num1)
        except Exception as e:
            print("您的输入非法，请重新输入！")
        else:
            break
    while 1:
        oper = input("请输入您的运算!：")
        if oper not in ["+", "-", "*", "/"]:
            print("您的输入非法，请重新输入！")
        else:
            break
    while 1:
        num2 = input("请输入您的第二个数据！：")
        try:
            num2 = float(num2)
        except Exception as e:
            print("您的输入非法，请重新输入！：")
        else:
            break
    if oper == '+':
        print(num1 + num2)
    elif oper == '-':
        print(num1 - num2)
    elif oper == '/':
        while 1:
            if num2 == 0:
                print("请重新输入，除数不可为0！")
                while 1:
                    try:
                        num2 = input("请重新输入第二个数据！")
                        num2 = float(num2)
                    except Exception as e:
                        print("您输入内容非法，请重新输入!")
                    else:
                        break
            else:
                break
        print(num1 / num2)
    elif oper == '*':
        print(num1 * num2)
except Exception as e:
    print('Exception')
else:
    print("The end")